#ifndef __BSP_ESP8266_H
#define __BSP_ESP8266_H

#include <stdbool.h>
#include <stdarg.h>
#include <stdint.h>
#include "usart.h"

#define USART huart2

#define WiFi_Name "Limo"
#define WiFi_PassWord "limo2003"
#define MQTT_URL "broker.emqx.io"
// #define MQTT_URL "test.jmqtt.io"
// #define MQTT_URL "broker.mqttdashboard.com"
#define MQTT_PORT 1883

#define MQTT_CLIENT_ID    "STM32F103C8T6"
#define MQTT_USERNAME     "Limo"
#define MQTT_PASSWORD     "Limo"

#define PUBLISH_TOPIC "/broker/mqtt/Limo"
#define SUBSCRIBE_TOPIC "/broker/mqtt/Limo_s"

#define MAX_RX_BUF_SIZE 1024 // 最大接收缓存字节数
#define MAX_TX_BUF_SIZE 1024  // 最大发送缓冲字节数

extern char rx_buffer[];
extern int rx_index;
// extern volatile uint8_t semaphoreReleased;

bool ESP8266_Cmd(char *cmd, uint32_t waittime, ...);
bool ESP8266_Init(void);
// bool MQTT_publish(const char *key, const char *value);
// bool MQTT_subscribe(void);
bool MQTT_Publish(const char *message);

#endif
